﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PostQuery.aspx.cs" Inherits="CentralOffice.WebClient.PublicAffairs.PostQuery" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../theme/2/style.css" />
</head>
<body class="bodycolor" topmargin="5">
<div style="margin-top:10px;"><img src="../images/sys_config.gif" WIDTH="22" HEIGHT="20" align="absmiddle" /><span class="big3">帖子查询</span></div>
    <form id="form1" runat="server">
    <ajaxToolkit:ToolkitScriptManager runat="server" ID="sm"  />
    <table class="TableBlock" width="100%" align="center">
   <tr>
       <td nowrap class="TableData">帖子标题：</td><td nowrap class="TableData"><asp:TextBox ID="txtName" runat="server" CssClass="BigInput"></asp:TextBox></td>
       <td nowrap class="TableData">帖子类型：</td><td nowrap class="TableData"><asp:DropDownList ID="ddlPostType" runat="server"></asp:DropDownList></td>
       <td nowrap class="TableData">发帖日期从：</td><td nowrap class="TableData"><asp:TextBox ID="txtPostDate" runat="server" CssClass="BigInput"></asp:TextBox>&nbsp;<img onclick="WdatePicker({el:$dp.$('txtPostDate')})" src="../inc/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle"></td>
   </tr>
   <tr>
       <td nowrap class="TableData">发帖人：</td><td nowrap class="TableData"><asp:TextBox ID="txtAuthor" runat="server" CssClass="BigInput"></asp:TextBox></td>
       <td nowrap class="TableData">帖子内容：</td><td nowrap class="TableData"><asp:TextBox id="txtContent" runat="server" CssClass="BigInput"></asp:TextBox></td>
       <td nowrap class="TableData">到：</td><td nowrap class="TableData"><asp:TextBox ID="txtPostDateEnd" runat="server" CssClass="BigInput"></asp:TextBox>&nbsp;<img onclick="WdatePicker({el:$dp.$('txtPostDateEnd')})" src="../inc/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle"></td>
       
   </tr>
   
   <tr>
   <td nowrap class="TableControl" colspan="3" align="center"><asp:Button ID="btnQuery" runat="server" Text="查询"  CssClass="BigButton" OnClick="btnQuery_Click" /></td>
   <td nowrap class="TableControl" colspan="3" align="center"><input type="button" value="发帖子" class="BigButton" onclick="window.location='PostAdd.aspx?operation=add';"><%--<input type="submit" value="复制" class="BigButton" style="margin-left:20px;">--%></td>
   </tr>
</table>


<div style="margin-top:20px; margin-left:8px;"><h3>查询结果：</h3></div>
<div style="text-align:center">
<asp:UpdatePanel UpdateMode="Conditional" ID="upCompany" runat="server" ChildrenAsTriggers="true">
<ContentTemplate>
<huag:OAGridView  id="gv" runat="server" DataKeyNames="Id" AllowSorting="True" 
        skinid="PagingGridView" Width="100%"  DataSourceID="odsPost"  
        EnableViewState="false" ConfirmDelete="true" onrowcreated="gv_RowCreated" ><%--OnDataExport="gv_DataExport" OnRowDataBound="gv_RowDataBound" --%>
   <Columns>
       <%--<asp:BoundField DataField="Name" HeaderText="名称" SortExpression="Name"  />--%>
       <asp:HyperLinkField DataTextField="Name" DataNavigateUrlFormatString="PostView.aspx?id={0}" DataNavigateUrlFields="Id" HeaderText="标题"  SortExpression="Name"/><%--target="_blank"--%>
       <huag:EnumTypeField DataField="Category" HeaderText="类别" SortExpression="Category" CategoryName="postType"  />
       <asp:BoundField DataField="CreatedTime" HeaderText="发帖日期" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="false" SortExpression="CreatedTime" />
       <asp:BoundField DataField="Author" HeaderText="发帖人" SortExpression="Author" />
       
       <asp:HyperLinkField  DataNavigateUrlFormatString="PostUpdate.aspx?id={0}&category={1}&operation=edit" DataNavigateUrlFields="Id,Category" Text="编辑" />
       <asp:CommandField ShowDeleteButton="True" DeleteText="删除" />
   </Columns>
</huag:OAGridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnQuery" />
</Triggers>
</asp:UpdatePanel>

<%--MaximumRowsParameterName="maxRows" StartRowIndexParameterName="startIndex"<asp:Parameter Name="startIndex" Type="Int32" /><asp:Parameter Name="maxRows" Type="Int32" /> <asp:Parameter Name="sortExpression" Type="String"/> --%>
<asp:ObjectDataSource id="odsPost" runat="server" EnablePaging="True" 
 TypeName="CentralOffice.PublicAffair.BusinessActions.Post" 
 SelectMethod="GetPaged" SelectCountMethod="GetCount"
 DeleteMethod="DeleteById"
 SortParameterName="sortExpression" onselecting="odsPost_Selecting">
    <SelectParameters>
      <asp:Parameter Name="whereClause" Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>
    </form>
    
    <script type="text/javascript" src="../inc/js/My97DatePicker/WdatePicker.js"></script>
</body>
</html>
